package com.zhai.boot.runner;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.CommandLineRunner;

import org.springframework.stereotype.Component;

/**
 * @package: com.zhai.boot
 * @project-name: zhai-boot
 * @description: 启动时输出配置信息
 * @author: Created by 翟凤玺
 * @create-datetime: 2018-9-5 11:15
 */
@Slf4j
@Component
public class StartupRunner implements CommandLineRunner {

    @Value("${spring.datasource.url}")
    private String SPRING_DATASOURCE_URL;

    @Override
    public void run(String... args) throws Exception {
        log.info(">>>>>>>>>>>>>>>>>>>>>>>>>> 配置信息 <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<");
        log.info("数据库连接url：" + SPRING_DATASOURCE_URL);
        log.info(">>>>>>>>>>>>>>>>>>>>>>>>>> 配置信息 <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<");
    }
}
